package com.chennan.factory.opt;

import com.chennan.factory.opt.impl.AddOperation;
import com.chennan.factory.opt.impl.DivOperation;
import com.chennan.factory.opt.impl.MulOperation;
import com.chennan.factory.opt.impl.SubOperation;

/**
 * 操作工厂类
 * @author chennan
 *
 */
public class OperationFactory {
	public static Operation createOperation(String opt){
		switch (opt) {
		case "+":
			return new AddOperation();
		case "-":
			return new SubOperation();
		case "*":
			return new MulOperation();
		case "/":
			return new DivOperation();
		default:return null;
		}
	}
}
